//类组件
import React, { PureComponent } from 'react'
 import { Button } from 'antd-mobile'
class App2 extends PureComponent {
    constructor(props) {
        super(props)

        this.state = {
            num:1
        }
    }
   addNum=()=>{
     this.setState({
        num:this.state.num +1
     })
   }
    render() {
        return (
            <div>
                 <h3>{this.state.num}</h3>
                 <Button color='primary' fill='solid' onClick={()=>this.addNum()}>
            数量+1
          </Button>
            </div>
        )
    }
}

export default App2